#include <bits/stdc++.h>
#define int long long
using namespace std;

inline int read(){
	int ans=0,f=1;
	char c=getchar();
	while(!isdigit(c)){
		if(c=='-') f=-1;
		c=getchar();
	}
	while(isdigit(c)){
		ans=(ans<<1)+(ans<<3)+(c^48);
		c=getchar();
	}
	return ans*f;
}

int n,a[100010],b[100010],p,q,ans;

signed main(){
	freopen("duel.in","r",stdin);
	freopen("duel.out","w",stdout);
	n=read();
	for(int i=1;i<=n;++i){
		a[i]=read();
		b[i]=a[i];
	}
	stable_sort(a+1,a+n+1);
	stable_sort(b+1,b+n+1);
	p=n,q=n-1;
	while(p>=1&&q>=1){
		if(a[p]>b[q]) ans++,p--,q--;
		else q--;
	}
	printf("%lld\n",n-ans);
	return 0;
}

